<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	template="/WEB-INF/templates/default.xhtml">
	<ui:define name="content">
		<h1>
			<h:outputText value="#{aktionEditController.title}" />
		</h1>
		<p:messages id="msgs" />
		<h:form id="editform" acceptcharset="ISO-8859-1">
			<p:tabView id="tabView">
				<p:tab title="Allgemein">
					<h:panelGrid columns="3">
						<h:outputLabel value="Name:" />
						<h:inputText id="a_name" value="#{aktionEditController.aktion.name}" />
						<p:message for="a_name" />
						<h:outputLabel value="Spendenziel:" />
						<h:panelGroup>
							<h:inputText id="a_spendenziel" value="#{aktionEditController.aktion.spendenZiel}">
								<f:convertNumber maxFractionDigits="2" minFractionDigits="2" />
							</h:inputText> €
						</h:panelGroup>
						<p:message for="a_spendenziel" />
						<h:outputLabel value="Spendenbetrag:" />
						<h:panelGroup>
							<h:inputText id="a_spendenbetrag" value="#{aktionEditController.aktion.spendenBetrag}">
								<f:convertNumber maxFractionDigits="2" minFractionDigits="2" />
							</h:inputText> €
						</h:panelGroup>
						<p:message for="a_spendenbetrag" />
					</h:panelGrid>
				</p:tab>
				<p:tab title="Bankverbindung">
					<h:panelGrid columns="3">
						<h:outputLabel value="Kontoinhaber:" />
						<h:inputText id="b_name" value="#{aktionEditController.aktion.konto.name}" size="60" />
						<p:message for="b_name" />
						<h:outputLabel value="Kontonummer:" />
						<h:inputText id="b_konto" value="#{aktionEditController.aktion.konto.kontoNr}" />
						<p:message for="b_konto" />
						<h:outputLabel value="Bankleitzahl:" />
						<h:inputText id="b_blz" value="#{aktionEditController.aktion.konto.blz}" />
						<p:message for="b_blz" />
						<h:outputLabel value="Name der Bank:" />
						<h:inputText id="b_name_bank" value="#{aktionEditController.aktion.konto.nameDerBank}" size="40" />
						<p:message for="b_name_bank" />
					</h:panelGrid>			
				</p:tab>
				<p:tab title="Spendenformular">
					<h:panelGrid columns="3">
						<h:outputLabel value="Hintergrundfarbe:" />
						<p:colorPicker id="c_bg_color" value="#{aktionEditController.aktion.formConfig.bgColor}" />
						<p:message for="c_bg_color" />
						<h:outputLabel value="Textfarbe:" />
						<p:colorPicker id="c_text_color" value="#{aktionEditController.aktion.formConfig.textColor}" />
						<p:message for="c_text_color" />
						<h:outputLabel value="Titel:" />
						<h:inputText id="c_titel" size="40" value="#{aktionEditController.aktion.formConfig.titel}" />
						<p:message for="c_titel" />
					</h:panelGrid>			
				</p:tab>
			</p:tabView>
			<br />
			<p:separator />
			<p:commandButton value="Speichern" action="#{aktionEditController.doSave}" ajax="false" />
			<p:commandButton value="Abbrechen" immediate="true" action="#{aktionEditController.doCancel}" ajax="false" />
		</h:form>
	</ui:define>
</ui:composition>
